<?php
header('Content-Type:text/html;charset=utf-8');
class InformationModel extends Model{

public function GetRes($config){
$sql='select name from `team` where `id`="'.$_GET['tid'].'"';
$res=$this->mysql->dql($sql)[0];
return $res;
}

public function GetNum($config){
$sql='select count(*) as u from player where `tid`="'.$_GET['tid'].'"';
$num=$this->mysql->dql($sql)[0];
return $num;
}

public function GetName($config){
$sql='select name from player where `tid`="'.$_GET['tid'].'"';
$name=$this->mysql->dql($sql);
return $name;
}

public function allTeam($config){
	$sql='select * from team';
	$allTeam=$this->mysql->dql($sql);
	return $allTeam;
}

public function doupdate($post){
$sql = "update `match` set `team1`='{$_POST['team1']}',`score`='{$_POST['score']}',`team2` = '{$_POST['team2']}' where `id`='{$_POST['id']}'";
return $this->mysql->dml($sql);
}

public function delete(){
$sql = "delete from `match` where `id`='{$_GET['id']}'";
return $this->mysql->dml($sql);
}
}
?>